// @charset "utf-8";
define(function (require, exports, module) {
(async()=>{ 
	try {
		commonMethod.init();

		var resetSizeFun = require('../base/resetsizeggzd');
		resetSizeFun.init();

		interactions.commonEvents();

		var control = require('./control');

		var ggzdView = require('./ggzdview');
		ggzdView.init();

		var xgsgView = require('./xgsgview');

		var rzrqView = require('./rzrqview');

		var swtichInit =async  function () {
			var timeBool0930 = await commonMethod.judgeIntime(['00:00', '09:30']);
			// var timeBool2359 = await commonMethod.judgeIntime(['09:30', '23:59']);
			if (timeBool0930) {
				if (xgsgView.hasIpo) {
					interactions.switchDefTab(1);
				} else {
					interactions.switchDefTab(2);
					await rzrqView.request();
				}
			}

			// if (timeBool0930 && xgsgView.hasIpo) {
			// 	// xgsg
			// 	interactions.switchDefTab(1);
			// 	// await xgsgView.request();
			// } else if (timeBool0930) {
			// 	// rzrq
			// 	interactions.switchDefTab(2);
			// 	await rzrqView.request();

			// } else if (timeBool2359) {
			// 	// ggzd
			// 	// interactions.switchDefTab(0);
			// }
		};
		await xgsgView.request(swtichInit);
		control.autodo();
		var swtichTabCall =async  function (index) {
			if (index == 1) {
				await xgsgView.request();
			} else if (index == 2) {
				await rzrqView.request();
				TA.log('zx_565d20c4_290');
			} else if (index == 0) {
				// var isToday = ggzdView.date == await commonMethod.serverTime();
				// var isTrade = commonMethod.thsQuote.isTradeTime('1A0001');
				// if (isTrade && isTrade) {
					ggzdView.requestData();
				// }
			}
		};
		await interactions.switchTab(swtichTabCall);

		$('.xgsg-more-btn').on('click', function() {
			commonMethod.thsQuote.switchPage(12820);
			TA.log("cop_561718aa_80");
		});
		$('.rzrq-more-btn').on('click', function() {
			commonMethod.thsQuote.actionCommand(43963);
			TA.log("zx_565d20c4_290");
		});

		TA.log('cop_56d3b7ed_677');
	} catch (e) {
		// alert('ggzdinit'+e.message);
	}
})();
});
